<extend name="Public/base"/>

<block name="body">
    <form method="POST"  id="form-export" action="{:U('exportstaffdetail',array('staffname'=>$staffname,'startDate'=>$startTime,'endDate'=>$endTime))}">
        <div class="main-title">
            <h2>员工分拣量统计</h2>
        </div>
        <div class="panel panel-default">
            <div class="panel-body">
                <div class="row">
                    <div class="col-md-1">
                        <h4 style="font-size: 16px;"><a class="btn btn-default"
                                                        href="{:U('staffstatistics',array('startDate'=>$startTime,'endDate'=>$endTime))}">返
                            回</a>
                        </h4>
                    </div>
                        <a class="btn btn-default" id="ExportSubmit">导出</a>
                </div>
            </div>
        </div>
        <div class="data-table table-striped">
            <table>
                <thead>
                <tr>
                    <th>任务编号</th>
                    <th>姓名</th>
                    <th>商品名称</th>
                    <th>规格</th>
                    <th>分拣量</th>
                </tr>
                </thead>
                <tbody>
                <notempty name="_list">
                    <volist name="_list" id="vo">
                        <tr>
                            <td>{$vo['missionnumber']}</td>
                            <td>{$vo['staffname']}</td>
                            <td>{$vo['product']}</td>
                            <td>{$vo['spec']}</td>
                            <td>{$vo['counts']}</td>
                        </tr>
                    </volist>
                    <else/>
                    <td colspan="4" class="text-center"> aOh! 暂时还没有内容!</td>
                </notempty>
                </tbody>
            </table>
        </div>
        <div class="page">
            {$_page}
        </div>
    </form>
</block>

<block name="script">
    <script type="text/javascript">
        $('#ExportSubmit').click(function () {
            document.getElementById("form-export").submit();
        });

        $(function () {
            $('.time').datetimepicker({
                format: 'Y-m-d',
                language: "zh-CN",
                minView: 2,
                autoclose: true
            });
        });

        $("#search").click(function () {
            var url = $(this).attr('url');

            var query = $('.search-form').find('input').serialize();
            var queryselect = $('.search-form').find('select').serialize();

            query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
            query = query.replace(/^&/g, '');
            queryselect = queryselect.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
            queryselect = queryselect.replace(/^&/g, '');

            if (url.indexOf('?') > 0) {
                url += '&' + query;
                url += '&' + queryselect;
            } else {
                url += '?' + query;
                url += '?' + queryselect;
            }

            window.location.href = url;
        });
        //回车搜索
        $(".search-input").keyup(function (e) {
            if (e.keyCode === 13) {
                $("#search").click();
                return false;
            }
        });
        highlight_subnav('{:U('Sort/staffstatistics')}');
    </script>
</block>